<?php

namespace App\Remote\TencentLbs;

use App\Exceptions\BaseException;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Request as RequestAlias;

class TencentLbsRemote extends Remote
{

    /**
     * 本接口提供由文字地址到经纬度的转换能力，并同时提供结构化的省市区地址信息。
     *
     * @param string $address
     * @return mixed|void
     * @throws BaseException
     * @throws GuzzleException
     */
    public static function addressAnalysis(string $address)
    {
        return self::customRequest(
            "/ws/geocoder/v1/",
            RequestAlias::METHOD_GET,
            array_merge(
                self::getConfig(),
                [
                    "address" => $address,
                ]
            )
        );
    }

}
